<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>弹框</title>
</head>

<body>
  <button class="btn" onclick="log.showModal()">弹框</button>
  <dialog id="log">
    <div class="win">
      <p>This is window</p>
      <button class="dialog-btn" onclick="log.close()">
        <span>关闭</span>
      </button>
    </div>
  </dialog>
</body>

</html>